pp108 : Example SOAP Messages for SAML Authentication

Example SOAP Messages for SAML Authentication

This topic describes examples where SOAP messages use SAML for authentication.


The following is an example SOAP request to get SAML assertions from Single Sign-On.

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <wsse:Username>jopl</wsse:Username>
                <wsse:Password>whateverthepasswordwillbeputithere</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </SOAP:Header>
    <SOAP:Body>
        <samlp:Request IssueInstant="2009-04-01T10:23:11Z"
            MajorVersion="1" MinorVersion="1"
            RequestID="a997c83a8d-b5d7-b930-edba-02e37ab1765" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol">
            <samlp:AuthenticationQuery>
                <saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
                    <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">jopl</saml:NameIdentifier>
                </saml:Subject>
            </samlp:AuthenticationQuery>
        </samlp:Request>
    </SOAP:Body>
</SOAP:Envelope>


The following is the SOAP response with SAML assertions from SSO.

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <samlp:Response
            InResponseTo="a997c83a8d-b5d7-b930-edba-02e37ab1765"
            IssueInstant="2009-04-01T11:23:11.679Z" MajorVersion="1"
            MinorVersion="1"
            ResponseID="A9D550166-1DC3-4AF4-9C56-271E028C2DFE" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol">
            <samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol">
                <samlp:StatusCode Value="samlp:Success"/>
            </samlp:Status>
            <saml:Assertion
                AssertionID="A4B413744-287C-4A8F-8D0D-C9283F19A339"
                IssueInstant="2009-04-01T11:23:11.679Z"
                Issuer="https://www.cordys.com/SSO" MajorVersion="1"
                MinorVersion="1" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
                <saml:Conditions NotBefore="2009-04-01T11:18:11.679Z"
                    NotOnOrAfter="2009-04-01T19:23:11.679Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"/>
                <saml:AuthenticationStatement
                    AuthenticationInstant="2009-04-01T11:23:11.679Z"
                    AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
                    <saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
                        <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">jopl</saml:NameIdentifier>
                    </saml:Subject>
                </saml:AuthenticationStatement>
            </saml:Assertion>
            <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
                <SignedInfo>
                    <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                    <Reference URI="#A4B413744-287C-4A8F-8D0D-C9283F19A339">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                        <DigestValue>WbVQ557X2lU2TcrmQb1hn4yOPkI=</DigestValue>
                    </Reference>
                </SignedInfo>
                <SignatureValue>R4fQ+wNie9Rey1+hAcDY3JVz3Dr7rUPOrd4JZuW7vhbTSJFSkaUw+lPYB/l8dEJIMTm699GwAq+mJ3jIV+ybea7eQ9XQTAfhZppAQnr+6k8kdkQnILliYJLk0WIzOII1l9OI/vi+AL8PzolYowSQhvrusKl3izKcAk9d+vL+6QY=</SignatureValue>
                <KeyInfo>
                    <X509Data>
                        <X509Certificate>MIIB4DCCAUmgAwIBAgIQaJsGtYWAXgC78iR/9KXGDDKNBgkqhliG9w0BAQUFADArMQ8wDQYDVQQKEwZzeXN0ZW0xGDAWBgNVBAbUDk8vbml0b3JAQ05EMTMwMDAeFw0wOTAzMDkxMzEyNTBaFw0xOTAzMDcxMzEyNTBaMDIxHzAdBgNVBAMTFnNpbmdsZSBzaWduLW9uIHNlcnZpY2UxDzANBgNVBAoTBnN5c3RlbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAur1NRnLrS9RepnKA1ZMyfzcfv4B5b2NxWDbTxbpWVbJq/p+Tp9r+akWWiRc20cZQH9esSJ9n3K8KLge/VLUPYSWKJt7P+gqLRaze4a/W51cYAC5QP+U/KP/UJ2csDw11MI0magDVQZ1fZTjO2s+j9LCcpqO0LBzXQTEhmrnZbxECAwEAATANBgkqhkiG9w0BAQUFAAOBgQCm3a4Eg94g9xqIswNhHu6b+yJpmHO8WDgHdGyZ2kQ0VezBa0ECit57aZszco7qG2ZIwnV5WxBYFD+PmcqjcXFhzkviHileZoTpWFcfEpySvokwlrGz9BDyrn6FyGC3YfZ8N0eeXyJW5AkNAD59CSnEbliLPNON2TQpeOaeL0roUg==    </X509Certificate>
                    </X509Data>
                </KeyInfo>
            </Signature>
            <samlp:AssertionArtifact xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol">MDF3eiA3HTMvRoDydILiGLihWu7akA65UvZOe0p5hka4siLYQInR/N1C</samlp:AssertionArtifact>
        </samlp:Response>
    </SOAP:Body>
</SOAP:Envelope>

Related concepts

SAML